feat: support apisixupstream#168
Merged
Merged
Conversation
…eam handling - Remove legacy ApisixUpstream controller. - Update related CRDs and deepcopy functions. - Add new translator logic for ApisixUpstream. - Introduce indexing and mapping logic for ApisixUpstream in ApisixRoute reconciliation.
- Implement `translateApisixUpstream` to support ApisixUpstream translation. - Add handling for externalNodes with types Domain and Service. - Update ApisixRoute translator to integrate ApisixUpstream references. - Introduce `SchemeToPort` and `MatchHostDef` utility functions for validation and defaults. - Enable e2e tests for ApisixRoute referencing ApisixUpstream.
- Moved HTTP rule handling to `processApisixRouteHTTPRule` for improved modularity. - Updated ApisixRoute controller to integrate the new function. - Enhanced indexing for ApisixRoute to include ApisixUpstream secrets and services. - Refactored e2e tests to validate updated ApisixRoute and ApisixUpstream logic.
Contributor
conformance test reportapiVersion: gateway.networking.k8s.io/v1
date: "2025-06-18T12:47:46Z"
gatewayAPIChannel: standard
gatewayAPIVersion: v1.2.0
implementation:
contact: null
organization: APISIX
project: apisix-ingress-controller
url: https://github.com/apache/apisix-ingress-controller.git
version: v2.0.0
kind: ConformanceReport
mode: default
profiles:
- core:
failedTests:
- HTTPRouteCrossNamespace
result: failure
skippedTests:
- HTTPRouteHTTPSListener
statistics:
Failed: 1
Passed: 31
Skipped: 1
name: GATEWAY-HTTP
summary: Core tests failed with 1 test failures. |
Contributor
conformance test reportapiVersion: gateway.networking.k8s.io/v1
date: "2025-06-18T12:53:34Z"
gatewayAPIChannel: standard
gatewayAPIVersion: v1.2.0
implementation:
contact: null
organization: APISIX
project: apisix-ingress-controller
url: https://github.com/apache/apisix-ingress-controller.git
version: v2.0.0
kind: ConformanceReport
mode: default
profiles:
- core:
result: partial
skippedTests:
- HTTPRouteHTTPSListener
statistics:
Failed: 0
Passed: 32
Skipped: 1
name: GATEWAY-HTTP
summary: Core tests partially succeeded with 1 test skips. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds support for referencing ApisixUpstream from ApisixRoute, including CRD updates, translation logic, controller/indexer adjustments, and an end-to-end test.
- Enable and implement
ApisixRoute→ApisixUpstreamlookup and translation in ADC translator and controller - Introduce
MatchHostDeffor validating domain names and update CRD/types for upstream retries - Add an e2e test covering externalName vs non-externalName service behavior
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/e2e/apisix/route.go | Unskip and implement e2e test for ApisixRoute referencing upstream |
| internal/utils/k8s.go | Add MatchHostDef regex and helper |
| internal/provider/provider.go | Track Upstreams in translation context |
| internal/provider/adc/translator/apisixupstream.go | New translator for ApisixUpstream |
| internal/provider/adc/translator/apisixroute.go | Extend route translator to use ApisixUpstream data |
| internal/controller/indexer/indexer.go | Add field index for ApisixUpstream and update service/secret indexes |
| internal/controller/apisixupstream_controller.go | Remove stub reconciler (status subresource removed) |
| internal/controller/apisixroute_controller.go | Wire up ApisixUpstream watch and loading in reconciler |
| config/crd/bases/apisix.apache.org_apisixupstreams.yaml | Update format for retries, remove status subresource |
| api/v2/shared_types.go | Add protocol/scheme, load-balancer, hashing constants |
| api/v2/apisixupstream_types.go | Change Retries to *int64 and remove status field |
| api/v2/zz_generated.deepcopy.go | Adjust deep-copy logic for updated types |
| api/adc/types.go & zz_generated.deepcopy.go | Add health-check, TLS, discovery, traffic-split fields and deep-copies |
Comments suppressed due to low confidence (1)
api/v2/shared_types.go:123
- [nitpick] The comment for
PassHostNodeis incorrect (it mentionsPassHostPass). Please update the comment to describeNodecorrectly.
// PassHostPass represents node option for pass_host Upstream settings.
…lators - Removed redundant `apisixUpstreams` and `adcUpstreams` variables in ApisixRoute translator logic for clarity. - Streamlined upstream handling and variable naming in traffic-split logic. - Updated TODO comments to reflect upcoming `.Checks`, `.TLS`, and `.Discovery*` implementations.
ronething
reviewed
Jun 18, 2025
…ests - Refactor `NewDefaultUpstream` initialization for streamlined field ordering. - Update e2e framework's `GetServiceEndpoints` to accept `types.NamespacedName`. - Incorporate upstream weights into traffic-split logic, including default handling and labels. - Add comprehensive e2e tests for mixed backend and upstream scenarios.
ronething
reviewed
Jun 18, 2025
…upstream # Conflicts: # internal/controller/apisixroute_controller.go # internal/controller/indexer/indexer.go # internal/provider/adc/translator/apisixroute.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of change:
What this PR does / why we need it:
实现了 ApisixRoute 引用 ApisixUpstream 的基本业务逻辑和添加了基本的测试。
更多的细节和测试在下个 PR 中提出。
.Status在这个 PR 中被删除了,将在下个 PR 中增加回来。Pre-submission checklist: